import request from '@/utils/request'

// 下拉小区
export function getSelectHome() {
  return request({
    url: '/community',
    method: 'get'
  })
}
// 活动管理
export function getInitData(data) {
  return request({
    url: '/service/activity',
    method: 'GET',
    params: {
      ...data
    }
  })
}
// 图片转化

export function uploadPic(data) {
  return request({
    url: '/base/upload?field=activity',
    method: 'POST',
    data

  })
}
// 添加项目
export function addData(data) {
  return request({
    url: '/service/activity',
    method: 'POST',
    data
  })
}
// 删除
export function delData(id) {
  return request({
    url: `/service/activity/${id}`,
    method: 'DELETE'

  })
}
// 修改
export function editData(data) {
  return request({
    url: `/service/activity/${data.id}`,
    method: 'PUT',
    data
  })
}
// 获取详情
export function getDetailData(id) {
  return request({
    url: `/service/activity/${id}`,
    method: 'GET'

  })
}

// 获取投诉
export function getComplainData(data) {
  return request({
    url: `/service/complain`,
    method: 'GET',
    params: {
      ...data
    }
  })
}

// 回复投诉详情

export function getComplainDetail(id) {
  return request({
    url: `/service/complain/${id}`,
    method: 'GET'
  })
}
// 回复修改投诉
export function editComplain(data) {
  return request({
    url: `/service/complain/${data.id}`,
    method: 'PUT',
    data
  })
}
// 删除投诉
export function delComplain(id) {
  return request({
    url: `/service/complain/${id}`,
    method: 'DELETE'

  })
}

// 获取报修
export function getRepairData(data) {
  return request({
    url: `/service/repair`,
    method: 'GET',
    params: {
      ...data
    }
  })
}

// 回复报修详情
export function getRepairDetail(id) {
  return request({
    url: `/service/repair/${id}`,
    method: 'GET'
  })
}
// 回复修改报修
export function editRepair(data) {
  return request({
    url: `/service/repair/${data.id}`,
    method: 'PUT',
    data
  })
}
// 删除报修
export function delRepair(id) {
  return request({
    url: `/service/repair/${id}`,
    method: 'DELETE'

  })
}
